<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JSON Test</title>
    <script type="text/javascript">
        var Person = {
            "vivian":{
                username:"王晓雯",
                sex:"女",
                age:20
            },
            "changjing":{
                username:"朱长静",
                sex:"女",
                age:22
            },
            "lanlan":{
                username:"刘兰兰",
                sex:"女",
                age:24
            }
        };

        var Person1 = {
            usernames:["王晓雯","朱长静","刘兰兰"],
            sexs:"女",
            ages:[20,22,24],
            jobs:"programmer"
        };

        window.onload = function(){
            document.getElementById("username").innerHTML = Person.vivian.username;
            document.getElementById("sex").innerHTML = Person.changjing.sex;
            document.getElementById("age").innerHTML = Person.lanlan.age;

            document.getElementById("usernames").innerHTML = Person1.usernames[1];
            document.getElementById("sexs").innerHTML = Person1.sexs;
            document.getElementById("ages").innerHTML = Person1.ages[1];
            document.getElementById("jobs").innerHTML = Person1.jobs;
        };
    </script>
</head>
<body>
<h2>JSON Test</h2>
<p>
    username:<span id="username"></span><br>
    sex:<span id="sex"></span><br>
    age:<span id="age"></span>
    <hr>
    username:<span id="usernames"></span><br>
    sex:<span id="sexs"></span><br>
    age:<span id="ages"></span><br>
    job:<span id="jobs"></span>
</p>
</body>
</html>